from pydantic import BaseModel, Field
from datetime import datetime
from typing import Dict, Optional, Any, List, Union
from bson import ObjectId


class Header(BaseModel):
    pass


class Query(BaseModel):
    pass


class Body(BaseModel):
    pass


class Response(BaseModel):
    pass


class Data(BaseModel):
    id: ObjectId = Field(default_factory=ObjectId, alias="_id")
    create_time: datetime
    url: str = ""
    path: str = ""
    method: str = ""
    header: Header = {}
    host: str = ""
    port: int
    scheme: str = ""
    query: Query = {}
    body: Optional[Union[list, dict]]
    response: Union[list, dict]
    status: int

    class Config:
        arbitrary_types_allowed = True
